#!/bin/sh
# 商品索引
curl -XDELETE 'http://localhost:9200/mall_center_item'
curl -XPUT 'http://localhost:9200/mall_center_item'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/mall_center_item/_mapping?pretty' -d '{
        "properties" : {
                "id" : { "type" : "keyword" },
                "name" : { "type" : "text", "analyzer": "ik_max_word" },
                "title" : { "type" : "completion", "analyzer": "ik_max_word" },
                "channel" : { "type" : "keyword" },
                "seller" : { "type" : "keyword" },
                "buyer" : { "type" : "keyword" },
                "catId" : { "type" : "keyword" },
                "catId1" : { "type" : "keyword" },
                "brand" : { "type" : "keyword" },
                "img" : { "type" : "keyword", "index": false },
                "price" : { "type" : "double" },
                "unit" : { "type" : "keyword", "index": false },
                "stockStatus" : { "type" : "keyword"},
                "sellNum" : { "type" : "long" },
                "param" : { "type" : "nested", "properties" : {"name" : { "type" : "keyword" }, "value" : { "type" : "keyword" }}}
        }
}'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/mall_center_item/_settings' -d '{
        "index" : {  "max_result_window" : 1000000 }
}'